<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浮动和文本对齐方式</title>
  <style>
    body {
      font-family: Arial, Helvetica, sans-serif;
      line-height: 1.4em;
    }
    .container {
      /* 最大宽度960px ，可以包含比960px小的宽度 */
      max-width: 960px;
      /* 居中对齐，div两步的margin外边距相同，上下外边距是30px */
      margin: 30px auto;
    }
    .box {
      background: #6d3636;
      border: 1px solid #333;
      padding: 20px;
      margin-bottom: 15px;
    }

    .box p {
      /* textalign 文本对齐 */
      text-align: left;
      text-align: right;
      text-align: center;
      /* 两端对齐 */
      text-align: justify;
    }

    #box-2 {
      width: 70%;
      float: left;
    }

    #box-3 {
      width: 30%;
      /* float,实现脱离文档流，内容宽度变小 */
      float: right;
    }
    
  </style>
</head>
<body>
  <div class="container">
    <div id="box-1" class="box">
      <h3>Heading</h3>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestias blanditiis iste porro ipsam laborum. Inventore non deserunt ab aperiam, 
        doloribus voluptatibus unde, accusamus iste repellat in maxime dolores voluptates reiciendis?
      </p>
    </div>

    <div id="box-2" class="box">
      <h3>Heading</h3>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestias blanditiis iste porro ipsam laborum. Inventore non deserunt ab aperiam, 
        doloribus voluptatibus unde, accusamus iste repellat in maxime dolores voluptates reiciendis?
      </p>
    </div>

    <div id="box-3" class="box">
      <h3>Heading</h3>
      <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestias blanditiis iste porro ipsam laborum. Inventore non deserunt ab aperiam, 
        doloribus voluptatibus unde, accusamus iste repellat in maxime dolores voluptates reiciendis?
      </p>
    </div>
  </div>
</body>
</html>